package com.crl.rcdp.monitor.dao;

import com.crl.dao.BaseDao;
import com.crl.rcdp.monitor.model.MonitorService;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description:
 * @author: 孔垂云
 * @version: 1.0
 * @date: 2020/8/9 0:25
 */
@Repository
public class MonitorServiceDao extends BaseDao<MonitorService, MonitorService> {

    public List<MonitorService> list() {
        String sql = "select * from td_monitor_service";
        return list(sql);
    }

    public void delete() {
        String sql = "delete from td_monitor_service";
        delete(sql);
    }

    public int add(MonitorService monitorService) {
        String sql = "insert into td_monitor_service(name, ip,port) values(:name,:ip,:port)";
        return insert(sql, monitorService);
    }

}
